<template>
	
	<view style="display: flex;" class="inforamtion">
		<view>
			<view class="option" style="width: 460rpx;">
				<view class="lf">项目名称</view>
				<view class="rl">{{ item.projectId_dictText }}</view>
			</view>
			<view class="option" style="width: 460rpx">
				<view class="lf">项目编号</view>
				<view class="rl">
					{{ item.projectCode }}
				</view>
			</view>
			<view class="option" style="width: 460rpx;">
				<view class="lf">业绩归属年度</view>
				<view class="rl">{{ item.attributionYear_dictText }}</view>
			</view>
			<view class="option" style="width: 460rpx;">
				<view class="lf">项目承接人</view>
				<view class="rl">{{ item.undertaker_dictText }}</view>
			</view>
			<view class="option" style="width: 460rpx;">
				<view class="lf">经营团队</view>
				<view class="rl">{{ item.teamId_dictText }}</view>
			</view>
			<view class="option" style="width: 460rpx;">
				<view class="lf">项目合同</view> 
				<view class="rl"> {{ item.projectContract_dictText }} </view>
			</view>
			<view class="option" style="width: 460rpx;">
				<view class="lf">合同款项</view>
				<view class="rl">{{ item.contractFund_dictText }}</view>
			</view>
			
			<view class="option" style="width: 460rpx;">
				<view class="lf">款项金额(元)</view>
				<view class="rl">{{ item.itemMoney }}</view>
			</view>
			<view class="option" style="width: 460rpx;">
				<view class="lf">预计回款时间</view>
				<view class="rl">{{ item.estimateRefundTime }}</view>
			</view>
			<view class="option" style="width: 460rpx;">
				<view class="lf">已开票金额(元)</view>
				<view class="rl">{{ item.onInvoiceAmount }}</view>
			</view>
			<view class="option" style="width: 460rpx;">
				<view class="lf">开票金额(元)</view>
				<view class="rl">{{ item.invoiceAmount }}</view>
			</view>
		</view>
		<view  style="flex: 1; display: flex; align-items: center; justify-content: flex-end;">
			<u-icon name="edit-pen-fill" color="#2979ff" size="20" @click="handleEidtForm(item)"></u-icon>
			<u-line direction="col" length="20" margin="0 10rpx"></u-line>
			<view class="icon custom-icon custom-icon-fuzhiwenjian" style="color:#2979ff;font-size: 20px"
				@click.stop="handleCopyForm(item, index)"></view>
			<u-line direction="col" length="20" margin="0 10rpx"></u-line>
			<u-icon name="trash-fill" color="red" size="20" @click.native.stop="handleRemoveForm(item)"></u-icon>
		</view>
	</view>
  <!-- <u-form labelWidth="auto" disabled>
    <u-form-item label="项目名称" prop="projectId" required>
      <h-select-project-input-popup
        v-model="item.projectId"
        projectStatus="2"
        class="w-100"
        placeholder="请选择项目名称"
        searchPlaceholder="请输入项目名称"
        border="none"
        :suffixIconStyle="{ color: '#B2B2B2' }"
        @change="selectProject"
      ></h-select-project-input-popup>
    </u-form-item>
    <u-form-item label="项目承接人" prop="undertaker">
      <h-select-person-input-popup
        disabled
        v-model="item.undertaker"
        class="w-100"
        placeholder="请选择项目承接人"
        searchPlaceholder="请输入"
        border="none"
        :suffixIconStyle="{ color: '#B2B2B2' }"
      ></h-select-person-input-popup>
    </u-form-item>
    <u-form-item label="业绩归属年度" prop="attributionYear">
      <h-select-input-tag
        disabled
        class="w-100"
        v-model="item.attributionYear"
        objectField="item.attributionYear"
        placeholder="请选择业绩归属年度"
        border="none"
        dictName="yjgsnd"
      ></h-select-input-tag>
    </u-form-item>
    <u-form-item label="经营团队" prop="teamId" required>
      <h-select-team-input-popup
        disabled
        style="width: 100%"
        v-model="item.teamId"
        objectField="item.teamId"
        placeholder="请选择经营团队"
        border="none"
        :tdlx="3"
        @detail="handleTeamChange"
      ></h-select-team-input-popup>
    </u-form-item>
    <u-form-item label="项目合同" prop="projectContract" required>
      <h-select-contract-manager-input-popup
        showName="1"
        htlx="1"
        :muitFlag="true"
        :projectId="item.projectId"
        v-model="item.projectContract"
        placeholder="请选择项目合同"
        border="none"
        style="width: 100%"
        :suffixIconStyle="{ color: '#B2B2B2' }"
        @change="changeProjectContract"
      ></h-select-contract-manager-input-popup>
    </u-form-item>
    <u-form-item label="合同款项" prop="contractFund" required>
      <h-select-checkoutlist-input-popup
        :contractId="item.projectContract"
        v-model="item.contractFund"
        placeholder="请选择合同款项"
        border="none"
        style="width: 100%"
        :suffixIconStyle="{ color: '#B2B2B2' }"
        @change="getCheckoutInfo"
      ></h-select-checkoutlist-input-popup>
    </u-form-item>
    <u-form-item label="款项金额（元)" prop="itemMoney">
      <u--input border="none" disabled v-number-normal placeholder="请输入款项金额" v-model="item.itemMoney"></u--input>
    </u-form-item>
    <u-form-item label="预计回款时间" prop="estimateRefundTime" required>
      <h-time-select
        mode="date"
        ref="estimateRefundTime"
        v-model="item.estimateRefundTime"
        placeholder="请选择预计回款时间"
        border="none"
        :suffixIconStyle="{ color: '#B2B2B2' }"
      ></h-time-select>
    </u-form-item>
    <u-form-item label="开票金额（元）" prop="invoiceAmount">
      <u--input border="none" v-number-normal placeholder="请输入开票金额" v-model="item.invoiceAmount"></u--input>
    </u-form-item>
    <view class="trip-form-action flex space-x-1">
      <view @click.stop.prevent="handleCopyForm(item)">
        <u-button size="small" type="primary">复制</u-button>
      </view>
      <view @click.stop.prevent="handleEidtForm(item)">
        <u-button size="small" type="primary">修改</u-button>
      </view>
      <view @click.stop.prevent="handleRemoveForm(item)">
        <u-button size="small" type="error">删除</u-button>
      </view>
    </view>
  </u-form> -->
</template>

<script>
export default {
  name: 'BillFormInfo',
  props: {
    formType: {
      type: String,
      default: 'basic',
    },
    index: {
      type: Number,
      default: null,
    },
    item: {
      type: Object,
      default: () => ({}),
    },
		// 是否作废
		isCancel:{
			type: String,
			default: '',
			required: false
		}
  },
  methods: {
    handleCopyForm(item) {
			uni.showModal({
			  content: '确定复制行吗?',
			  success: (res) => {
			    if (res.confirm) {
			      this.$emit('copy', [item, this.index])
			    }
			  },
			})
    },
    handleEidtForm(item) {
			if (!this.isCancel) {
				uni.showToast({
					title: '请选择是否作废!',
					icon: 'none'
				})
				return false
			}
      this.$emit('edit', [item, this.index])
    },
    handleRemoveForm(item) {
      uni.showModal({
        content: '确定删除吗？',
        success: (res) => {
          if (res.confirm) {
            this.$emit('remove', item)
          }
        },
      })
    },
  },
}
</script>
<style lang="scss" scoped>
	
	.inforamtion {
	  margin-top: 10rpx;
	  padding: 10rpx;
	  border-radius: 15rpx;
	  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
	}
	/deep/ .u-form-item__body{
		padding: 0px !important;
	}
</style>
